imcontextwayland: Ignore preedit updates from NULL to NULL
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 26 Apr 2022 10:23:09 +0000 (12:23 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 2 May 2022 21:34:09 +0000 (23:34 +0200)
If we get consecutive preedit string updates that announce a NULL
string, we still do end up issuing ::preedit-changed with those.
Ignore changes from NULL to NULL, it is the other combinations which
must issue this signal.

modules/input/imwayland.c

index 9b738208d9747dc2b4aec7e90629fc42dc9a01f6..1e93123aa2ba9d43af7402455c49ff49fc54274f 100644 (file)
@@ -171,6 +171,9 @@ text_input_preedit_apply (GtkIMContextWaylandGlobal *global)
     return;
 
   context = GTK_IM_CONTEXT_WAYLAND (global->current);
+  if (context->pending_preedit.text == NULL &&
+      context->current_preedit.text == NULL)
+    return;
 
   state_change = ((context->pending_preedit.text == NULL)
                  != (context->current_preedit.text == NULL));